<?php
namespace app\common\validate;

use think\validate;

class RuleValidate extends validate
{
    protected $rule = [
        'title' => 'require',
        'name'  => 'require|unique:auth_rule',
    ];

    protected $scene = [
        'edit' => [
            'name'  => 'require|unique:auth_rule,name',
        ],
    ];

    protected $message = [
        'title'        => '条件不能为空',
        'name.unique'  => '规则已经存在',
        'name.require' => '请填写规则名称',
    ];
}
